@property

Brightcells 8 年之前
父节点
当前提交
4ff27acb27
共有 1 个文件被更改,包括 2 次插入3 次删除
  1. 2 3
      photo/models.py

+ 2 - 3
photo/models.py

@@ -19,15 +19,14 @@ class UUIDInfo(CreateUpdateMixin):
19 19
     def __unicode__(self):
20 20
         return u'{0.pk}'.format(self)
21 21
 
22
-    def _data(self):
22
+    @property
23
+    def data(self):
23 24
         return {
24 25
             'pk': self.pk,
25 26
             'uuid': self.uuid,
26 27
             'lensman_id': self.lensman_id,
27 28
         }
28 29
 
29
-    data = property(_data)
30
-
31 30
 
32 31
 class PhotosInfo(CreateUpdateMixin):
33 32
     lensman_id = models.CharField(_(u'lensman_id'), max_length=255, blank=True, null=True, help_text=u'摄影师唯一标识', db_index=True)